{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab inline\n",
    "import matplotlib.pyplot as plt\n",
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import numpy.random as rng\n",
    "import pandas_datareader.data as web\n",
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_prices(symbol):\n",
    "    start, end = '2007-05-02', '2016-04-11'\n",
    "    data = web.DataReader(symbol, 'google', start, end)\n",
    "    data=pd.DataFrame(data)\n",
    "    prices=data['Close']\n",
    "    prices=prices.astype(float)\n",
    "    return prices\n",
    "\n",
    "def get_returns(prices):\n",
    "        return ((prices-prices.shift(-1))/prices)[:-1]\n",
    "    \n",
    "def get_data(list):\n",
    "    l = []\n",
    "    for symbol in list:\n",
    "        rets = get_returns(get_prices(symbol))\n",
    "        l.append(rets)\n",
    "    return np.array(l).T\n",
    "\n",
    "def sort_data(rets):\n",
    "    ins = []\n",
    "    outs = []\n",
    "    for i in range(len(rets)-100):\n",
    "        ins.append(rets[i:i+100].tolist())\n",
    "        outs.append(rets[i+100])\n",
    "    return np.array(ins), np.array(outs)\n",
    "        \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "symbol_list = ['C', 'GS']\n",
    "rets = get_data(symbol_list)\n",
    "ins, outs = sort_data(rets)\n",
    "ins = ins.transpose([0,2,1]).reshape([-1, len(symbol_list) * 100])\n",
    "div = int(.8 * ins.shape[0])\n",
    "train_ins, train_outs = ins[:div], outs[:div]\n",
    "test_ins, test_outs = ins[div:], outs[div:]\n",
    "\n",
    "#normalize inputs (this is new but not specific to PG; you should always normalize inputs)\n",
    "train_ins, test_ins = train_ins/np.std(ins), test_ins/np.std(ins)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sess = tf.InteractiveSession()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "positions = tf.constant([-1,0,1]) #long, neutral or short\n",
    "num_positions = 3\n",
    "\n",
    "x = tf.placeholder(tf.float32, [None, len(symbol_list) * 100])\n",
    "y_ = tf.placeholder(tf.float32, [None,  len(symbol_list)])\n",
    "\n",
    "W = tf.Variable(tf.random_normal([len(symbol_list) * 100, num_positions * len(symbol_list)]))\n",
    "b = tf.Variable(tf.random_normal([num_positions * len(symbol_list)]))\n",
    "\n",
    "# we define our model: y = W*x + b\n",
    "y = tf.matmul(x, W) + b # y is tensor of shape [num_inputs, num_positions * len(symbol_list)]\n",
    "# a row of y will look like [prob_symbol_1_short, prob_symbol_1_neutral, prob_symbol_1_long, prob_symbol_2_short, ...]\n",
    "# note that they are not really probabilities because I did not perform a softmax yet\n",
    "\n",
    "\n",
    "# loop through symbols, taking the buckets for one symbol at a time\n",
    "pos = {}\n",
    "symbol_returns = {}\n",
    "relevant_target_column = {}\n",
    "for i in range(len(symbol_list)):\n",
    "    # ISOLATE the buckets relevant to the symbol and get a softmax as well\n",
    "    symbol_probs = y[:,i*num_positions:(i+1)*num_positions]\n",
    "    symbol_probs_softmax = tf.nn.softmax(symbol_probs) # softmax[i, j] = exp(logits[i, j]) / sum(exp(logits[i]))\n",
    "    # SAMPLE probability to chose our policy's action\n",
    "    sample = tf.multinomial(tf.log(symbol_probs_softmax), 1)\n",
    "    pos[i] = tf.reshape(sample, [-1]) - 1   # choose(-1,0,1)\n",
    "    # GET RETURNS by multiplying the policy (position taken) by the target return for that day\n",
    "    symbol_returns[i] = tf.multiply(tf.cast(pos[i], float32),  y_[:,i])\n",
    "    # isolate the output probability the selected policy (for use in calculating gradient)\n",
    "    #    see https://github.com/tensorflow/tensorflow/issues/206 for TF discussion including my solution\n",
    "    sample_mask = tf.reshape(tf.one_hot(sample, 3), [-1,3])\n",
    "    relevant_target_column[i] = tf.reduce_sum(symbol_probs_softmax * sample_mask,1)\n",
    "    \n",
    "\n",
    "# calculate the PERFORMANCE METRICS for the data chosen\n",
    "daily_returns_by_symbol = tf.concat(axis=1, values=[tf.reshape(t, [-1,1]) for t in symbol_returns.values()]) \n",
    "daily_returns = tf.reduce_sum(daily_returns_by_symbol,1)/2\n",
    "total_return = tf.reduce_prod(daily_returns + 1)\n",
    "ann_vol = tf.multiply(\n",
    "    tf.sqrt(tf.reduce_mean(tf.pow((daily_returns - tf.reduce_mean(daily_returns)),2))) ,\n",
    "    np.sqrt(252)\n",
    "    )\n",
    "sharpe = total_return / ann_vol\n",
    "\n",
    "# since we only train the sampled classes, we will combine them so that we can feed them into cross entropy\n",
    "training_target_cols = tf.concat(axis=1, values=[tf.reshape(t, [-1,1]) for t in relevant_target_column.values()])\n",
    "# we want to either push the gradient toward our selection or away from it. We use these ones to find the direction\n",
    "#     of the gradient, which we will then multiply by our fitness function\n",
    "ones = tf.ones_like(training_target_cols)\n",
    "\n",
    "# this isnt actually a gradient, but karpathy sort of calls it one. Since it's a tensor it sort of is a gradient anyway\n",
    "gradient = tf.nn.sigmoid_cross_entropy_with_logits(labels=training_target_cols, logits=ones) ####should this be a prob???\n",
    "\n",
    "# COST\n",
    "# how should we do this step? it depends how we want to group our results. Choose your own adventure here by uncommenting a cost fn\n",
    "# this is the most obvious: we push each weight to what works or not. Try it out...we're gonna be RICH!!!! oh, wait...\n",
    "#cost = tf.multiply(gradient , daily_returns_by_symbol)\n",
    "# this takes the overall daily return and pushes the weights so that the overall day wins. Again, it overfits enormously\n",
    "cost = tf.multiply(gradient , tf.reshape(daily_returns,[-1,1]))\n",
    "# this multiplies every gradient by the overall return. If the strategy won for the past ten years, we do more of it and vice versa\n",
    "#cost = tf.multiply(gradient , total_return)\n",
    "\n",
    "# minimize the cost (push the weights where we want them to go)\n",
    "optimizer = tf.train.GradientDescentOptimizer(0.1).minimize(cost)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch: 1000 cost= 23840.125000000 total return= 23839.125000000\n",
      "Epoch: 2000 cost= 154422.281250000 total return= 154421.281250000\n",
      "Epoch: 3000 cost= 421916.937500000 total return= 421915.937500000\n",
      "Epoch: 4000 cost= 504377.406250000 total return= 504376.406250000\n",
      "Epoch: 5000 cost= 854653.875000000 total return= 854652.875000000\n"
     ]
    }
   ],
   "source": [
    "init = tf.global_variables_initializer()\n",
    "sess.run(init)\n",
    "for epoch in range(5000):\n",
    "    sess.run(optimizer, feed_dict={x: train_ins, y_: train_outs})#.reshape(1,-1).T})\n",
    "    if (epoch+1)%1000== 0:\n",
    "        c,t = sess.run([cost, total_return], feed_dict={x: train_ins, y_: train_outs})#.reshape(1,-1).T})\n",
    "        print(\"Epoch:\", '%04d' % (epoch+1), \"cost=\", \"{:.9f}\".format(t), \"total return=\", \"{:.9f}\".format(t-1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# in sample results\n",
    "d, t = sess.run([daily_returns, gradient], feed_dict={x: train_ins, y_: train_outs})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x10647ad30>]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAD8CAYAAACLrvgBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4HNWZ7/Hvq32x5N3G+4JtbAMBjDAmEAgGjA0DZsgy\nZDKDQwhkEsgyJDdjBkJIJgtJbpKB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YZzbg6wCLjGzM6MX+h/1aTVkD0LHiV8MfA7X5TOx/cQ6XhM\nu2JmNwBtwP2+aAcw0Tl3EnAd8ICZlYYVX5yM+gzE+RSJP356/fgqaQS2AxPi5sf7stCZWS5Bwrjf\nOfcogHNul3Mu4pyLAv/NwSaS0N+Hc267/7sb+L2PbVd7s5P/u9tXDz1ebxGwyjm3C9L7+Mbp6TEN\nPXYz+wzwN8CnfaLDN/Ps9dMrCfoFZvjY4puwUhrvEXwG0uH45gCXAg+1l/XF8VXSCCwHppvZFP+r\n8zJgWcgxtbdP3g2sd879NK48vt3/b4H2URTLgMvMLN/MpgDTCTq7UhVvsZmVtE8TdH6+5eNqH62z\nBHgsLt7L/YifeUBtXJNLKiX8OkvX49tBT4/pk8ACMxvqm1oW+LKUMLOFwDeAi51zDXHlI80s209P\nJTimm3zMdWY2z/8/uDzuPaYi3p5+BtLhO+Rc4B3nXKzZqU+Ob1/07mfii2DUybsEmfiGsOPxMZ1B\n0OywBnjTvy4Afg2s9eXLgDFx69zg38MG+mi0STfxTiUYNbIaWNd+HIHhwDPARuAvwDBfbsDPfbxr\ngbIQjnExsBcYHFeWVseXIKHtAFoJ2p6vPJJjStCXUO5fV6Q43nKCNv/2z/Gdvu7H/GflTWAVcFHc\ndsoIvqzfA/4TfzFyiuLt8WcgVd8hncXry38F/FOHur1+fHVFuIiIJE3NUyIikjQlDRERSZqShoiI\nJE1JQ0REkqakISIiSVPSEBGRpClpiIhI0pQ0REQkaf8fhx9zoJ4QPqIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x111fe8748>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# equity curve\n",
    "plot(np.cumprod(d+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "#out of sample results\n",
    "d, t = sess.run([daily_returns, gradient], feed_dict={x: test_ins, y_: test_outs})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x10821a4e0>]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXd4XOWV/z/vdPUuF1nuDdsY2xgDoXdCKIFNgTTSfmw2\nsJtsyLKwS4CQvpslQJaEwIawEBKWQBJMCcXYVNNs3HCXjYua1bs09f39ce8dzUgzqiPNSHM+z6NH\nd95778yrO/b3nnvOec9RWmsEQRCE9MCW7AkIgiAI44eIviAIQhohoi8IgpBGiOgLgiCkESL6giAI\naYSIviAIQhohoi8IgpBGiOgLgiCkESL6giAIaYQj2RPoS3FxsZ49e3aypyEIgjCh2Lx5c4PWumSw\n41JO9GfPns2mTZuSPQ1BEIQJhVLq8FCOE/eOIAhCGiGiLwiCkEaI6AuCIKQRIvqCIAhphIi+IAhC\nGiGiLwiCkEaI6AuCIKQRIvopxuHGTv62oybZ0xAEYZKScouz0hmtNWf956sA7LjjQnI8zuROSBCE\nSYdY+inEB0dawtvbK1uTOBNBECYrIvopxKGGzvD2liPNSZyJIAiTFRH9FKKqpRuAsvwMPqxqS/Js\nBEGYjIjopxBVzd0UZ7uZW5JFbVtPsqcjCMIkREQ/hahu7aasIIMpuR7qRPQFQRgDRPRHwdsHGlm3\n6xha65j73z/UxOybn2NP7dBcNVXN3czIz2BKrpu6di+hkKa2tYefv7iXHn8wkVMXBCFNGVT0lVIP\nKaXqlFIfxtmvlFL3KqUqlFLblVKrIvYFlVJbzZ+1iZx4smns8HLNg+/w9Uc28cz22Hn1z5njGysa\nB30/rTVVLd1Mz/cwJddDIKSpbu3mlJ+8wn9vqOCDwxLYFQRh9AzF0n8YuHiA/R8HFpg/1wG/jtjX\nr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5oxemBj/m42x39hHjfZ+RawO+L1xL82\nWusJ/wOcCrwY8foW4JZkzysJ12E28GHE673ANHN7GrDX3P4NcE2s49LhB3gauECuT9Q1yQQ+AE7G\nWHDkMMfD/7cwWqaeam47zONUsuc+htdkBoYxcC7wLKAmw7WZFJY+UAYcjXhdaY6lO1O01jXmdi0w\nxdxO2+tlPnavBN5Fro/lvtgK1AEvAweAFq11wDwk8m8PXxdzfytQNL4zHlfuBm4CQubrIibBtZks\noi8MgjZMkLRO1VJKZQNPAd/WWrdF7kvX66O1DmqtV2BYtWuAxUmeUkqglLoUqNNab072XBLNZBH9\nKqA84vUMcyzdOaaUmgZg/q4zx9PueimlnBiC/5jW+s/msFwfE611C7ABw2WRr5RymLsi//bwdTH3\n5wGN4zzV8eI04HKl1CHgcQwXzz1MgmszWUT/fWCBGVl3AVcDa5M8p1RgLXCtuX0thi/bGv+SmaVy\nCtAa4eaYdCilFPBbYLfW+q6IXWl9fZRSJUqpfHM7AyPOsRtD/D9lHtb3uljX61PAevMJadKhtb5F\naz1Daz0bQ0/Wa60/z2S4NskOKiQw6HIJsA/DJ/nvyZ5PEv7+PwI1gB/D1/g1DJ/iK8B+YB1QaB6r\nMLKdDgA7gNXJnv8YX5vTMVw324Gt5s8l6X59gOXAFvO6fAjcZo7PBd4DKoA/AW5z3GO+rjD3z032\n3zBO1+ls4NnJcm1kRa4gCEIaMVncO4IgCMIQENEXBEFII0T0BUEQ0ggRfUEQhDRCRF8QBCGNENEX\nBEFII0T0BUEQ0ggRfUEQhDTi/wP3r79BYQteeAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x106463a20>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#out of sample results\n",
    "plot(np.cumprod(d+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
